﻿namespace BM.Tools.WebControls.MForm.Controls.Helper
{
    using System;
    using System.Web.UI.WebControls;

    /// <summary>
    /// This class is used to expose ASP.NET <see cref="BaseCompareValidator"/> protected static methods.
    /// </summary>
    internal class DummyCompareValidator : BaseCompareValidator
    {
        /// <summary>
        /// Determines the order in which the month day and year appear in a date value for a current culture.
        /// </summary>
        /// <returns>
        /// the order of date elements.
        /// </returns>
        public static new string GetDateElementOrder()
        {
            return BaseCompareValidator.GetDateElementOrder();
        }

        /// <summary>
        /// Compares two strings using the specified operator and data type.
        /// </summary>
        /// <param name="leftText">
        /// the left text.
        /// </param>
        /// <param name="rightText">
        /// the right text.
        /// </param>
        /// <param name="op">
        /// the operator
        /// </param>
        /// <param name="type">
        /// the comparison data type
        /// </param>       
        /// <returns>
        /// whether the comparison is valid.
        /// </returns>
        public static new bool Compare(string leftText, string rightText, ValidationCompareOperator op, ValidationDataType type)
        {            
            return BaseCompareValidator.Compare(leftText, rightText, op, type);
        }

        /// <summary>
        /// Do not use this method.
        /// </summary>
        /// <returns>
        /// always throws an exception.
        /// </returns>
        protected override bool EvaluateIsValid()
        {
            throw new NotSupportedException();
        }
    }
}
